package com.you.concurrent.juc.countdownlatch;

import sun.java2d.SurfaceDataProxy;

import java.util.concurrent.CountDownLatch;

public class BatchExecuteTaskDemo {

    static CountDownLatch countDownLatch = null;
    static int threadNum = 10;

    public static void main(String[] args) throws InterruptedException {
        while (true) {
            countDownLatch = new CountDownLatch(threadNum);
            for (int i = 0; i < threadNum; i++) {
                new Thread(new BatchExecuteTaskThread(i, countDownLatch)).start();
            }
            countDownLatch.await();
            System.out.println("----------main is end!---------");
        }
    }
}
